package com.hyy.libray.presenter;


import com.hyy.libray.common.Constant;
import com.hyy.libray.contract.BaseLoadMoreContract;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName LoadMorePresenter
 * @Author hyy
 * @Description
 * @Date 2019/1/9
 * @Time 10:35 AM
 */
public abstract class BaseLoadMorePresenter<V> extends BasePresenter<V> implements BaseLoadMoreContract.IPresenter {

    protected Map paramsMap;

    protected int mCurPage;

    @Override
    public void initListParams(boolean isRefresh) {

        if (isRefresh) {
            mCurPage = 1;
        } else {
            mCurPage++;
        }
        if (paramsMap == null) {
            paramsMap = new HashMap();
        }
        paramsMap.put("page", "" + mCurPage);
        paramsMap.put("pageNum", Constant.PAGE_SIZE + "");
    }
}
